package com.deyuanyun.pic.pbf.controller.dto.defect.node;

import com.deyuanyun.pic.common.util.ObjectUtil;
import com.deyuanyun.pic.common.util.format.NumberFormat;
import com.deyuanyun.pic.pbf.domain.CPSurvey;

/**
 * 5,阴保调查记录表
 *
 * @author huanglw
 * @date 2016-6-29
 *
 * History: [修改人][时间][修改描述]
 */
public class CPSurveyDto extends NodeDto {

    /**
     * 土壤电阻率
     */
    private String soilResistivity;

    /**
     * 自然电位（-mV）
     */
    private String freeCorrosionPotential;

    /**
     * 通电电位（-mV）
     */
    private String onPotential;

    /**
     * 极化电位（-mV）
     */
    private String polarizedPotential;

    /**
     * 直流干扰-最大值（mV）
     */
    private String maxPotential;

    /**
     * 直流干扰-最小值（mV）
     */
    private String minPotential;

    /**
     * 交流干扰电压（V）
     */
    private String acPotential;

    /**
     * 是否完成该节点任务：0，没有完成；1，已经完成
     */
    private Short isCompletion;

    public CPSurveyDto(Short isCompletion) {
        this.isCompletion = isCompletion;
    }

    public Short getIsCompletion() {
        return isCompletion;
    }

    public void setIsCompletion(Short isCompletion) {
        this.isCompletion = isCompletion;
    }

    public String getSoilResistivity() {
        return soilResistivity;
    }

    public void setSoilResistivity(String soilResistivity) {
        this.soilResistivity = soilResistivity;
    }

    public String getFreeCorrosionPotential() {
        return freeCorrosionPotential;
    }

    public void setFreeCorrosionPotential(String freeCorrosionPotential) {
        this.freeCorrosionPotential = freeCorrosionPotential;
    }

    public String getOnPotential() {
        return onPotential;
    }

    public void setOnPotential(String onPotential) {
        this.onPotential = onPotential;
    }

    public String getPolarizedPotential() {
        return polarizedPotential;
    }

    public void setPolarizedPotential(String polarizedPotential) {
        this.polarizedPotential = polarizedPotential;
    }

    public String getMaxPotential() {
        return maxPotential;
    }

    public void setMaxPotential(String maxPotential) {
        this.maxPotential = maxPotential;
    }

    public String getMinPotential() {
        return minPotential;
    }

    public void setMinPotential(String minPotential) {
        this.minPotential = minPotential;
    }

    public String getAcPotential() {
        return acPotential;
    }

    public void setAcPotential(String acPotential) {
        this.acPotential = acPotential;
    }

    public void fromDomain(CPSurvey domain) {

        if (ObjectUtil.isEmptyAll(domain)) {
            return;
        }

        // 土壤电阻率
        this.soilResistivity = NumberFormat.format(domain.getSoilResistivity());
        // 自然电位（-mV）
        this.freeCorrosionPotential = NumberFormat.format(domain.getFreeCorrosionPotential());
        // 通电电位（-mV）
        this.onPotential = NumberFormat.format(domain.getOnPotential());
        // 极化电位（-mV）
        this.polarizedPotential = NumberFormat.format(domain.getPolarizedPotential());
        // 直流干扰-最大值（mV）
        this.maxPotential = NumberFormat.format(domain.getMaxPotential());
        // 直流干扰-最小值（mV）
        this.minPotential = NumberFormat.format(domain.getMinPotential());
        // 交流干扰电压（V）
        this.acPotential = NumberFormat.format(domain.getAcPotential());

        // 赋值
        super.fromDomain(domain.getId(), domain.getCreateRemark());
    }
}